package com.cloudkinto.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 * @author hua
 * @since 2025-06-17
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_platform_order_sync_record")
public class PlatformOrderSyncRecordDo extends Model<PlatformOrderSyncRecordDo> {

    private static final long serialVersionUID=1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableField("platform_code")
    private String platformCode;

    @TableField("store_id")
    private Long storeId;

    /**
     * 同步设定开始时间
     */
    @TableField("begin_time")
    private Date beginTime;

    /**
     * 同步设定结束时间
     */
    @TableField("end_time")
    private Date endTime;

    @TableField("execute_time")
    private Date executeTime;

    @TableField("finish_time")
    private Date finishTime;

    /**
     * 同步类型 增量订单 全量订单 手动同步
     */
    @TableField("sync_type")
    private Integer syncType;

    /**
     * 同步状态 等待同步 同步中 同步成功 同步失败
     */
    @TableField("sync_status")
    private Integer syncStatus;

    /**
     * 同步次数
     */
    @TableField("sync_count")
    private Integer syncCount;

    /**
     * 同步失败原因
     */
    @TableField("fail_reason")
    private String failReason;

    /**
     * 同步订单数
     */
    @TableField("order_count")
    private Integer orderCount;

    @TableField("create_time")
    private Date createTime;

    @TableField("create_by")
    private Long createBy;

    @TableField("update_time")
    private Date updateTime;

    @TableField("update_by")
    private Date updateBy;

    @TableField("delete_flag")
    @TableLogic
    private Integer deleteFlag;

    @TableField("company_id")
    private Long companyId;


    public PlatformOrderSyncRecordDo() {
    }

    public PlatformOrderSyncRecordDo(String platformCode, Long storeId, Integer syncType, Integer syncStatus, Integer syncCount, Date createTime, Long createBy) {
        this.platformCode = platformCode;
        this.storeId = storeId;
        this.syncType = syncType;
        this.syncStatus = syncStatus;
        this.syncCount = syncCount;
        this.createTime = createTime;
        this.createBy = createBy;
    }

    public PlatformOrderSyncRecordDo(String platformCode, Long storeId, Integer syncType, Integer syncStatus, Integer syncCount, Date createTime, Long createBy, Long companyId) {
        this.platformCode = platformCode;
        this.storeId = storeId;
        this.syncType = syncType;
        this.syncStatus = syncStatus;
        this.syncCount = syncCount;
        this.createTime = createTime;
        this.createBy = createBy;
        this.companyId = companyId;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
